package dhbw.GUI.Window;

import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.jws.Oneway;
import javax.swing.*;

import Main.MyController;

import com.jgoodies.forms.builder.PanelBuilder;
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;

import dhbw.Data.Language;
import dhbw.Data.Settings;
import dhbw.GUI.Panels.PanelLogin;

public class WindowLogin extends JFrame{

	private JTextField tf_username;
	private JPasswordField pf_password;
	private JButton bt_login;
	private boolean debug;
	private MyController myc;
	private JButton bt_loginAsStudent;
	private JButton bt_loginAsDozent;
	private JButton bt_loginAsProfessor;
	private JButton bt_loginAsStudiengangsleiter;
	private JPanel debugPanel;
	

	public WindowLogin(MyController myc, boolean debug) {
		this.debug = debug;
		this.myc = myc;
		buildWindow();
	}

	/**
	 * Build JFrame
	 */
	private void buildWindow() {
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
		this.setResizable(false);
		this.setBackground(Settings.BG_COLOR);
		this.setIconImage(Settings.LOGO_ICON.getImage());
		this.setTitle(Settings.APPLICATION_NAME+" - "+Language.LOGIN[0]);
		this.add(BorderLayout.CENTER, new PanelLogin(this.myc, this.debug, this));
		this.pack();
		myc.centerJFrame(this);
		this.setVisible(true);
	}
}
